package day_16;

import java.util.Scanner;

public class ques1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Scanner scan=new Scanner(System.in);
        int n=scan.nextInt();
        if(n==1){
            System.out.println(0);
            return;
        }
        int sum=0;
        for(int i=1;i<=n;i++){
            if(isPerfect(i)){
                sum++;
            }
        }

        System.out.println(sum);
    }

    public static boolean isPerfect(int index){
        int count=0;
        for(int i=1;i<index;i++){
            if(index%i==0){
                count+=i;
            }
        }

        return count==index;
    }
}
